<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>选择人员</title>
    <link rel="stylesheet" href="/static/lib/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <table class="layui-hide" id="empTableId" lay-filter="empTableFilter"></table>
    </div>
</div>
<script src="/static/lib/layui/layui.js" charset="utf-8"></script>
<script>
    var checkbox = [];

    layui.use(['table'], function () {
        var $ = layui.jquery,
            table = layui.table;

        table.render({
            elem: '#empTableId',
            url: '/emp/select',
            response: {
                statusCode: 200 //规定成功的状态码，默认：0
                , countName: 'total' //规定数据总数的字段名称，默认：count
            },
            cols: [
                [
                    {type: "radio", width: "10%"},
                    {field: 'name', width: "40%", title: '人员名称', align: "center"},
                    {field: 'telephone', width: "50%", title: '人员电话', align: "center"}
                ]
            ],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page:true,
            skin: 'line'
        });

        table.on('radio(empTableFilter)', function(obj){
            checkbox['id']=obj.data.id;
            checkbox['name']=obj.data.name;
            checkbox['telephone']=obj.data.telephone;
        });
    });
</script>

</body>
</html>